package com.ufox.utils;

import com.alibaba.fastjson.JSON;
import com.ufox.entity.User;

import javax.servlet.http.HttpServletRequest;

public class UserUtil {

    public static  User getUser(HttpServletRequest request,RedisUtils redisUtils) {
        String token = request.getHeader("Authorization");
        String jsonUser = (String)redisUtils.get(token);
        User user = JSON.parseObject(jsonUser, User.class);
        return user;
    }
}
